﻿using System;
using System.Collections.Generic;
using System.Text;
using Lswweb.Model;
using Lswweb.Common;

namespace Lswweb.IDAL
{
    public interface IOrders
    {
        OrderInfo GetOrder(int orderId);

        int Insert(OrderInfo info);

        /// <summary>
        ///  删除信息
        /// </summary>
        /// <returns></returns>
        bool Delete(int orderId);

        bool Update(OrderInfo info);

        bool Update(int orderId, OrderStatus statusType);

        bool UpdatePayment(PaymentInfo paymentInfo);

        bool UpdateLogistics(LogisticsInfo logisticsInfo);

        OrderStatus GetStatus(int orderId);

        IList<OrderItemInfo> GetOrderItems(int orderId);

        OrderItemInfo GetFirstOrderItem(int orderId);

        /// <summary>
        /// 查询用户产品列表 
        /// </summary>
        /// <param name="status">记录状态，可以为非枚举内部值，为非内部值表示查询所有状态的记录。</param>
        /// <param name="pageSize">每页记录条数</param>
        /// <param name="pageIndex">页索引</param>
        /// <param name="record">所有记录条数</param>
        /// <returns></returns>
        IList<OrderInfo> GetOrders(int userId,OrderStatus status, int pageSize, int pageIndex, out int record);

        IList<OrderInfo> GetOrders(string searchKey,Pair<DateTime?> dateRange,OrderStatus? status,int pageSize,int pageIndex,out int record);

        IList<ProductInfo> GetSalesRanking(Pair<DateTime> dateTimeRang, int topNumber);

        int GetNotEndOrderNumber(int userId);

        decimal GetBuyTotalMoney(int userId,Pair<DateTime?> dateTimeRange);

        int GetEndOrderNumber(int userId);
    }
}
